import React, { useMemo, useState } from 'react'

function App() {
    const [count, setCount] = useState(0);
    const [value, setValue] = useState("");
    const treatCount = useMemo(() => {
        console.log('treatCount');
        return count + 10;
    },[count])
    return (
        <div>
            {/* treatCount: {treatCount()}<br /> */}
            count:{count}<button onClick={() => setCount(count + 1)}>点击</button><br />
            <input
                type="text"
                value={value}
                onInput={(e) => {
                    setValue(e.target.value);
                }}
            />
        </div>
    )
}

export default App